﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>USER CENTER</title>
		<%@ include file="/share/include.jsp" %>
		<!-- <script src="js/jquery.min.js"></script> -->
   		 <meta name="viewport" content="width=device-width, initial-scale=1">
		 <script type="application/x-javascript"> 
			addEventListener("load", function() { 
				setTimeout(hideURLbar, 0); 
			}, false); 
			function hideURLbar(){ 
				window.scrollTo(0,1); 
			} 
		</script>
		<script type="text/javascript">
			$(function(){
				//表单提交前 验证 表单
		        $("#updateForm").Validform({
					btnSubmit : "#btn_sub",
					tiptype : 3,
					beforeCheck:function(curform){
						 
					 },
					 beforeSubmit:function(data){
						 
					 }
				});
				
				$('#userHead').click();
			});
		</script>
	</head>
	<body>
		<!-- container -->
		<!-- header -->
		<div class="header">
			<%@ include file="/control/jsp/layout/header.jsp" %>
			<!-- /bottom-header -->
		</div>
		<!-- header -->
		<!--- top-nav -->
			<%@ include file="/control/jsp/layout/userMenu.jsp" %>
		<!--- top-nav -->
		<!-- Product-Details-page -->
		<div class="details-page">
			<div class="content details-page">
				<div class="product-details">
					<div class="container">
						<div class="details-left" style="width: 100%;margin-top: 20px;">
						    <h4 style="color:red;"><img style="padding: 10px;" src="${root}/images/bx.gif" />Edit Information</h4>
							<form id="updateForm" action="${root }/control/user/userController/edit.do" method="post" enctype="multipart/form-data">
								<input type="hidden" name="userId" value="${user.userId }" />
							    <div class="text_info">
									<div class="info_" style="height:250px">
										<div class="info_l">Avatar:</div>
										<div class="info_r1">
										    <span id="userHeadShow">
												<c:if test="${not empty user.userHead}">
													<img id="userHeadImage" src="${imageService }${user.userHead}" alt="" style="width: 200px;height: 200px;" /><br/>
												</c:if>
												<c:if test="${empty user.userHead}">
													<img id="userHeadImage" src="${root}/images/user_logo.png" height="200" width="200" /><br/>
												</c:if>
											</span>
											<input type="hidden" name="oldUserHead" value="${user.userHead}" />
											<input type="hidden" id="userHeadValue" name="userHead" value="${user.userHead}"  dataType="*"/>
											<input class="l_input" style="width: 25%;" type="button" id="userHead" value="上传头像" onclick="uploadImage('userHead','userHeadShow','userHeadValue','${imageService}');" />
										</div>
									</div>
									<div class="info_">
										<div class="info_l">Username:</div>
										<div class="info_r2"><span id="">${fn:escapeXml(user.userName)}</span></div>
									</div>
									<div class="info_">
										<div class="info_l">Your Name:</div>
										<div class="info_r2"><input name="realName" type="text" id="realName" class="l_input" style="width:60%;" value="${fn:escapeXml(user.realName)}" maxlength="50" dataType="*1-50"></div>
									</div>
									<div class="info_">
										<div class="info_l">Address:</div>
										<div class="info_r2"><input name="userAddress" type="text" id="userAddress" class="l_input" style="width:60%;" value="${fn:escapeXml(user.userAddress)}" maxlength="100" dataType="*1-100"></div>
									</div>
									<div class="info_">
										<div class="info_l">Tel:</div>
										<div class="info_r2"><input name="userPhone" type="text" id="userPhone" class="l_input"  style="width:60%;" value="${fn:escapeXml(user.userPhone)}"  maxlength="20" dataType="*1-20"></div>
									</div>
									<div class="info_">
										<div class="info_l">Email:</div>
										<div class="info_r2"><input name="email" type="text" id="email" class="l_input" style="width:60%;" value="${fn:escapeXml(user.email)}"  maxlength="100" dataType="*1-100"></div>
									</div>
									<div class="info_" style="text-align:center;margin-top:50px;">
										<input type="submit" name="BtnSubmit" value="Submit" id="BtnSubmit" class="p-btn"> &nbsp;&nbsp;
										<input type="reset" class="p-btn" onclick ="javascript:history.go(-1);" value="Cancel">
									</div>
									<div class="clearfix"> </div>
								</div>
							</form>
						</div>
						<div class="clearfix"> </div>
					</div>
			    </div>
		    </div>
		</div>
		<!-- /Product-Details-page -->
		<!-- footer -->
		<%@ include file="/control/jsp/layout/footer.jsp" %>
</body>
</html>

